<?php
namespace Mobile\Controller;
use Think\Controller;
use Common\Model\Movie;
class PayController extends Controller {
    public function index(){
        $id=$_GET['id'];
        $model=D('Order');
        $res=$model->setAll($id);
        $res['mlang']=Movie::langAlias($res['mlang']);
        //var_dump($res);exit;
        $row=explode(',',$res['oir']);
        $col=explode(',',$res['oic']);
        for($i=0;$i<count($row);$i++){
            $seat[$i]['row']=$row[$i];
            $seat[$i]['col']=$col[$i];
        }
        $num=count($row);
        //var_dump($seat);exit;
        $this->assign('num',$num);
        $this->assign('seat', $seat);
        $this->assign('res', $res);
        $this->display();

       /* $screeningId=$_GET['screeningId'];
        $movieId=$_GET['movieId'];
        //电影信息
        $list=M('movie')->where(['id'=>$movieId])->select();
        foreach($list as $k=>$v)
        {
            $list[$k]['language']=Movie::langAlias($v['language']);
        }
        //var_dump($list);exit;
        //场次信息
        $screeningInfo = M('screening')->where(['id'=>$screeningId])->find();
        //var_dump($screeningInfo);exit;
        $seatInfo=M('order_item')->query("select seat_row,seat_column from pre_order_item  where screening_id =".$screeningId);
        //分割排和做为单独的数组
        foreach($seatInfo as $k=> $v){
            $seatInfo[$k]['seat_row']= explode(',',$v['seat_row']);
            $seatInfo[$k]['seat_column']= explode(',',$v['seat_column']);
        }
        //var_dump($seatInfo);exit;
      */
    }
}

